package org.apache.ibatis.demo.generator;

import java.util.Random;

/**
 * BankCardGenerator
 *
 * @author zhaohui
 * @date 2019/12/12 18:35
 */
public class BankCardGenerator {

    private static final Random random = new Random();

    private static final int BANK_CARD_LENGTH = 16;

    public static String randomBankCard() {
        StringBuilder sf = new StringBuilder();
        for (int i = 0; i < BANK_CARD_LENGTH; i++) {
            int index = random.nextInt(DataDict.BANK_CARD_NUMBERS.length);
            sf.append(DataDict.BANK_CARD_NUMBERS[index]);
        }
        return sf.toString();
    }
}
